﻿/*==============================================================================
	TASK 9:                                                {Console InputOutput}
	Write a program to print the first 100 members of the sequence of Fibonacci:
    0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377,...    
==============================================================================*/

using System;
using System.Numerics;
using System.Diagnostics;

class FibonacciFirst100Members
{
    static void Main()
    {
        Stopwatch sw = new Stopwatch();
        sw.Start();
        DateTime startTime = DateTime.Now;

        Console.Write("".PadLeft(80,'*'));
        Console.WriteLine("This is fibonacci first 100 members:".PadLeft(50));
        Console.WriteLine("".PadLeft(80,'*'));
        BigInteger a;
        BigInteger a0=0;
        BigInteger a1=1;
        int n=100;
        Console.WriteLine("a1={0}", a1);
        for (int i = 2; i <= n; i++)
        {
            a = a0 + a1;
            a0 = a1;
            a1 = a;
                Console.WriteLine("a{0}={1}",i,a);
        }
        sw.Stop();
        DateTime endTime = DateTime.Now;
        Console.WriteLine(sw.Elapsed);
        Console.WriteLine("time:{0}",endTime-startTime);
    }
}

